/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Munliga
 */
@Entity
@Table(name = "m_map_doctor_specialist")
@NamedQueries({
    @NamedQuery(name = "MMapDoctorSpecialist.findAll", query = "SELECT m FROM MMapDoctorSpecialist m"),
    @NamedQuery(name = "MMapDoctorSpecialist.findById", query = "SELECT m FROM MMapDoctorSpecialist m WHERE m.id = :id")})
public class MMapDoctorSpecialist implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID")
    private Long id;
    @JoinColumn(name = "m_specialist_ID", referencedColumnName = "ID")
    @ManyToOne(optional = false)
    private MSpecialist mSpecialist;
    @JoinColumn(name = "m_doctor_ID", referencedColumnName = "ID")
    @ManyToOne(optional = false)
    private MDoctor mDoctor;

    public MMapDoctorSpecialist() {
    }

    public MMapDoctorSpecialist(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public MSpecialist getMSpecialist() {
        return mSpecialist;
    }

    public void setMSpecialist(MSpecialist mSpecialist) {
        this.mSpecialist = mSpecialist;
    }

    public MDoctor getMDoctor() {
        return mDoctor;
    }

    public void setMDoctor(MDoctor mDoctor) {
        this.mDoctor = mDoctor;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MMapDoctorSpecialist)) {
            return false;
        }
        MMapDoctorSpecialist other = (MMapDoctorSpecialist) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.MMapDoctorSpecialist[id=" + id + "]";
    }

}
